﻿using System;
using System.Collections.Generic;
using System.Text;
using FunctionalCLR.Core;

namespace FunctionalCLR.Shell.Function.Flow {
    public class ReturnNode : FuncNode {

        public ReturnNode()
            : base() {
            base.Value = "return";
        }

        public override FuncNode GetReversedFunction(int index) {
            throw new NotImplementedException();
        }

        public override object Evaluate() {
            object result = Children[0].Evaluate();

            throw new ReturnException(result);
        }
    }
}
